{extend name="public:base" /}
{block name="theme"}日志管理{/block}
{block name="small_theme"}日志列表{/block}
{block name="breadcrumb"}
<li><a href="{:url('index')}">日志列表</a></li>
<li class="active">日志首页</li>
{/block}
{block name="content"}
<!--<link rel="stylesheet" href="__CSS__/style.css">-->
<link rel="stylesheet" href="__CSS__/indexcommon.css">
<section class="content" style="min-height: 60px;font-size: 14px;">
    <form method="post" action="{:url('index')}" >
        <div class="box_">
            <div class="box_left">
                <div class="form-group">
                    <label>订单ID</label>
                    <input type="text" class="form-control" name="order_id" placeholder="ID" value="{$map.order_id}" >
                </div>
                <div class="form-group">
                    <label>日志类型</label>
                    <select class="form-control" name="log_type">
                        <option value="0" >全部</option>
                        <option value="1" {eq name="$map.log_type" value="1"}selected="selected"{/eq}>微信日志</option>
                        <option value="2" {eq name="$map.log_type" value="2"}selected="selected"{/eq}>短信日志</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>是否成功</label>
                    <select class="form-control" name="is_success">
                        <option value="0" >全部</option>
                        <option value="1" {eq name="$map.is_success" value="1"}selected="selected"{/eq}>成功</option>
                        <option value="2" {eq name="$map.is_success" value="2"}selected="selected"{/eq}>失败</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>发送者</label>
                    <select class="form-control" name="send_id">
                        <option value="0" >全部</option>
                        {volist name="user" id="data"}
                        <option value="{$data.id}" {eq name="$map.send_id" value="$data.id"}selected="selected"{/eq}>{$data.username}</option>
                        {/volist}
                    </select>
                </div>
                <div class="form-group">
                    <label>接收者</label>
                    <select class="form-control" name="receive_id">
                        <option value="0" >全部</option>
                        {volist name="user" id="data"}
                            <option value="{$data.id}" {eq name="$map.receive_id" value="$data.id"}selected="selected"{/eq}>{$data.username}</option>
                        {/volist}
                    </select>
                </div>
                <div style="margin-left: 20px;">
                    <button class="btn btn-primary">开始查询</button>
                </div>
            </div>
        </div>
    </form>
</section>
<!-- 查询结束 -->
<!-- 列表开始 -->
<div class="row">
    <div class="col-xs-12">
        <div class="box box-list">
            <div class="box-header" data-original-title="" style="height: 40px;">
                <!--<a href="javascript:catorder('{:url('add')}');"  class="btn"><h2 style="margin-top: 0;"><i class="glyphicon glyphicon-plus"></i> 增加类别</h2></a>-->
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding" style="border-bottom: 1px solid #dfdfdf;overflow: hidden;">
                <table class="table table-striped table-bordered table-condensed">
                    <tr>
                        <th>ID</th>
                        <th>日志类型</th>
                        <th>日志状态</th>
                        <th>接收者</th>
                        <th>发送者</th>
                        <th>订单id</th>
                        <th>发送的消息</th>
                        <th>失败消息</th>
                        <th>创建时间</th>
                        <th>ip</th>
                        <th>操作</th>

                    </tr>
                    {volist name='wesmslog' id="vo" }
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.log_type_text}</td>
                        <td>{$vo.is_success_text}</td>
                        <td>
                            {empty name="vo.reuser.username"}
                                {$vo.receive_id}
                            {else /}
                                {$vo.reuser.username}
                            {/empty}
                        </td>
                        <td>{eq name='vo.iszjs' value='1'}{$vo.zjsuser.username}{else/}{$vo.touser.username}{/eq}</td>
                        <td>{$vo.order_id}</td>
                        <td><span class="tanchu" data-toggle="tooltip" data-placement="right" title="{$vo.send_msg}">{$vo.send_msg|msubstr=0,4}</span></td>
                        <td><span class="tanchu" data-toggle="tooltip" data-placement="right" title="{$vo.error_msg}">{$vo.error_msg|msubstr=0,4}</span></td>
                        <td>{$vo.create_time}</td>
                        <td>{$vo.ip}</td>
                        <td>
                        </td>
                    </tr>
                    {/volist}

                </table>
            </div>
            <!-- /.box-body -->
            <!--<ul class="pagination pagination-centered pagination-list">
                <li><a href="#">上一页</a></li>
                <li class="active">
                    <a href="#">1</a>
                </li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">下一页</a></li>
            </ul>-->
            <div class="page">{$page}</div>
        </div>
        <!-- /.box -->
    </div>
</div>
<!-- 列表结束 -->
</div>
{/block}

{block name="moal"}
<!-- 弹出层 开始-->
<div class="content-wrapper layer-box" id="layerbox" style="margin-left: 0;">
    <div class="row" style="padding:15px;">
        <div class="col-xs-12">
            <div class="box box-list box-noborder" style="margin-top: 20px;">
                <div class="box-header" data-original-title="" style="height: 40px;background: #efefef;">
                    <h2><i class="glyphicon glyphicon-cog"></i>搜索选择</h2>
                    <input class="chose-btn" type="button" id="all" value="全选">
                    <input class="chose-btn" type="button" id="uncheck" value="不选">
                    <input class="chose-btn" type="button" id="othercheck" value="反选">
                    <input class="sz-btn qd-btn" type="button" value="确定">
                    <input class="sz-btn back-btn" type="button" value="返回">
                </div>
                <div class="box-body table-responsive" id="check-div">
                    <label><input type="checkbox">&nbsp;ID</label>
                    <label><input type="checkbox">&nbsp;姓名</label>
                    <label><input type="checkbox">&nbsp;微信</label>
                    <label><input type="checkbox">&nbsp;手机</label>
                    <label><input type="checkbox">&nbsp;客服</label>
                    <label><input type="checkbox">&nbsp;订单时间</label>
                    <label><input type="checkbox">&nbsp;订单类别</label>
                    <label><input type="checkbox">&nbsp;ID</label>
                    <label><input type="checkbox">&nbsp;姓名</label>
                    <label><input type="checkbox">&nbsp;微信</label>
                    <label><input type="checkbox">&nbsp;手机</label>
                    <label><input type="checkbox">&nbsp;客服</label>
                    <label><input type="checkbox">&nbsp;订单时间</label>
                    <label><input type="checkbox">&nbsp;订单类别</label>
                </div>
            </div>
        </div>
    </div>
    <div class="row" style="padding:15px;">
        <div class="col-xs-12">
            <div class="box box-list box-noborder">
                <div class="box-header" data-original-title="" style="height: 40px;background: #efefef;">
                    <h2><i class="glyphicon glyphicon-cog"></i>列表选择</h2>
                    <input class="chose-btn" type="button" id="box-all" value="全选">
                    <input class="chose-btn" type="button" id="box-uncheck" value="不选">
                    <input class="chose-btn" type="button" id="box-othercheck" value="反选">
                    <input class="sz-btn qd-btn" type="button" value="确定">
                    <input class="sz-btn back-btn" type="button" value="返回">
                </div>
                <div class="box-body table-responsive" id="check-box">
                    <label><input type="checkbox">&nbsp;ID</label>
                    <label><input type="checkbox">&nbsp;姓名</label>
                    <label><input type="checkbox">&nbsp;微信</label>
                    <label><input type="checkbox">&nbsp;手机</label>
                    <label><input type="checkbox">&nbsp;微信</label>
                    <label><input type="checkbox">&nbsp;地区</label>
                    <label><input type="checkbox">&nbsp;建单时间</label>
                    <label><input type="checkbox">&nbsp;渠道</label>
                    <label><input type="checkbox">&nbsp;来源</label>
                    <label><input type="checkbox">&nbsp;类别</label>
                    <label><input type="checkbox">&nbsp;预约进店</label>
                    <label><input type="checkbox">&nbsp;邀约客服</label>
                    <label><input type="checkbox">&nbsp;线下门店</label>
                    <label><input type="checkbox">&nbsp;线下门市</label>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="js"}
<script type="text/javascript" src="__JS__/moment.js"></script>
<script type="text/javascript" src="__JS__/daterangepicker.js"></script>
<script type="text/javascript" src="__JS__/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="__JS__/bootstrap-timepicker.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>


<script type="text/javascript">
    function catorder(name) {
        layer.open({
            type: 2,
            title: '<h4>类别管理</h4>',
            shadeClose: true,
            shade: 0.8,
            area: ['650px', '90%'],
            content:name, //iframe的url
            end:function(){
                history.go(0);
            }
        });
    }
    function editquanxian(name) {
        $.get(name,function(msg){
            if(msg.status == 1){
                location.href=msg.url;
            }else{
                layer.msg(msg.info, {icon: msg.icon});
            }
        });
    }
    function del(name){
        layer.confirm('您确实删除订单？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post(name,function(data){
                if(data.status==2){
                    var ico=2;
                }else if(data.status==1){
                    var ico=1;
                }else if(data.status==0){
                    var ico=2;
                }else{
                    var ico=4;
                }
                layer.msg(data.msg, {
                    icon: ico,
                    time:2000,
                },function(){
                    history.go(0);
                });
            });

        });
    }




    $(function(){
        $('#showlayer').click(function(){
            $('.layer-box').show();
        });
        // $('#abtn').click(function(){
        // 	$('.layer-box').show();
        // });
        $('#closebtn').click(function(){
            $('.layer-box').hide();
        })
        var layertext=$('#layerbox').text();
        $('#abtn').on('click', function(){
            var layertext=$('#layerbox').html();
            layer.open({
                type: 1,
                title: false,
                area: ['1000px', '560px'],
                shadeClose: true, //点击遮罩关闭
                content: layertext
            });
        });
        var checkall=$('#all');
        var uncheck=$('#uncheck');
        var othercheck=$('#othercheck');
        var checkdiv=$('#check-div');
        checkall.click(function(){
            checkdiv.find("input[type='checkbox']").prop('checked',true);
        })
        uncheck.click(function(){
            checkdiv.find("input[type='checkbox']").prop('checked',false);
        })
        othercheck.click(function(){
            checkdiv.find("input[type='checkbox']").each(function(){
                $(this).prop("checked", !$(this).prop("checked"));
            })
        })

        var checkallbox=$('#box-all');
        var uncheckbox=$('#box-uncheck');
        var otherbox=$('#box-othercheck');
        var checkbox=$('#check-box');
        checkallbox.click(function(){
            checkbox.find("input[type='checkbox']").prop('checked',true);
        })
        uncheckbox.click(function(){
            checkbox.find("input[type='checkbox']").prop('checked',false);
        })
        otherbox.click(function(){
            checkbox.find("input[type='checkbox']").each(function(){
                $(this).prop("checked", !$(this).prop("checked"));
            })
        })
    })
    highlight_subnav("{:url('index')}");
    $('.tanchu').hover(function (){
        $(this).tooltip('toggle');
    });
</script>
{/block}
